


from rest_framework.viewsets import ModelViewSet
from meiduo_admin.serializers.group_serializers import *
from meiduo_admin.utils.pages import MyPage
from rest_framework.generics import ListAPIView
from django.contrib.auth.models import Permission
from meiduo_admin.serializers.perm_serializers import *

class GroupPermSimpleView(ListAPIView):
    queryset = Permission.objects.all()
    serializer_class = PermModelSerializer



class GroupViewSet(ModelViewSet):
    queryset = Group.objects.all()
    serializer_class = GroupModelSerializer

    pagination_class = MyPage

    def get_queryset(self):
        return self.queryset.order_by('id')